<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : ""; 
%>
<!DOCTYPE HTML>
<html>
  <head>
    <%@include file="../common.jsp"%>
    <title>课程列表</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">  
	<link rel="stylesheet" type="text/css" href="resources/css/common.css">
	<script type="text/javascript" src="resources/js/course/course.js"></script>  
	<script type="text/javascript" src="resources/js/framejs/jquery.form.js"></script>  
	<!--kindEditor -->
    <link rel="stylesheet" href="resources/js/kindeditor/themes/default/default.css" />
	<link rel="stylesheet" href="resources/js/kindeditor/plugins/code/prettify.css" />
	<script charset="utf-8" src="resources/js/kindeditor/kindeditor.js"></script>
	<script charset="utf-8" src="resources/js/kindeditor/lang/zh_CN.js"></script>
	<script charset="utf-8" src="resources/js/kindeditor/plugins/code/prettify.js"></script> 	
	
	<script src="resources/js/tag/jquery.tagsinput.js"></script>
	<link href="resources/js/tag/jquery.tagsinput.css" rel="stylesheet" />	

<script>
 		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content1"]', {
				cssPath : 'resources/js/kindeditor/plugins/code/prettify.css',
				uploadJson : 'resources/js/kindeditor/jsp/upload_json.jsp',
				fileManagerJson : 'resources/js/kindeditor/jsp/file_manager_json.jsp',
				allowFileManager : true,
				afterBlur: function(){
					this.sync();
				}
			});
			prettyPrint();
		});
		
		var userId = "${userId}";
		alert(userId);
	</script>
  </head>
  <body>
   	<div class="content">
   		<h4>课程列表管理</h4>
   		<hr/>
   		<!-- 查询面板 -->
<!-- 	<div class="panel panel-default">
		    <div class="panel-heading">
		      <h4 class="panel-title">
		        <a data-toggle="collapse" data-parent="#accordion" href="#collapseSearch">
		           	<i class="icon icon-search"></i> 查询过滤
		        </a>
		      </h4>
		    </div>
		    <div id="collapseSearch" class="panel-collapse collapse out">
		      <div class="panel-body">
				  <form id="form_search" class="form-horizontal">
			        <div class="form-group">
			          	<label class="col-md-1 control-label">昵称</label>
			          	<div class="col-md-4">
			             	<input type="text" name="nickName" id="search_nickName" class="form-control" placeholder="模糊查询...">
			          	</div>
			          	<label class="col-md-1 control-label">手机号</label>
			          	<div class="col-md-4">
			             	<input type="text" name="phone" id="search_phone" class="form-control" placeholder="模糊查询...">
			          	</div>
			        </div>
			        <div class="form-group">
			          <div class="col-md-offset-1 col-md-11">
			             <button id="btn_search" class="btn btn-default"><i class="icon icon-search"></i> 查询</button>
			             <button id="btn_reset" class="btn btn-default"><i class="icon icon-undo"></i> 重置</button>
			          </div>
			        </div>
			      </form>
		      </div>
		    </div>
		</div> -->
		
	    <!-- 工具栏 -->
   		<div class="tools"> 
	    	<button id="btn_add" type="button" class="btn btn-primary"><i class="icon icon-plus-sign"></i>  添加课程</button>
<!-- 	    <button id="btn_scan" type="button" class="btn btn-primary"><i class="icon icon-plus-sign"></i>  论文详情</button> -->
	    	<button id="btn_del" type="button"  class="btn btn-warning"><i class="icon icon-minus-sign"></i>  删除</button>	
	    </div> 
	    <!-- 列表 -->
	    <table id="tab_list" class="table table-hover table-striped mytable">
			<thead>
				<tr>
					<th style="width: 2%;"><input id="pkall" type='checkbox' class='checkbox'></th>
					<th style="width: 5%;">序号</th>
					<th style="width: 14%;">标题 </th>
					<th style="width: 15%;">上传时间</th>
					<th style="width: 8%;">下载次数</th>
					<th style="width: 8%;">收藏次数</th>
				 	<th style="width: 6%;">评价数</th>
					<th style="width: 7%;">浏览次数 </th>
					<th style="width: 8%;">是否认证</th>
					<th style="width: 8%;">是否删除</th>
					<th style="width: 19%;">操作</th>
				</tr>
			</thead>
			<tbody>
				
			</tbody>
	  	</table>
	  	<!-- 分页信息条 -->
	  	<div id="pagebar" class="pagebar">
		  	<ul class="pager">
		  		
			</ul>
			<p id="page_info" class="page_info">显示第<span>0</span>到第<span>0</span>条记录,共<span>0</span>条</p>
	  	</div>
	  	<!--  增加课程-->
	  	<div class="modal fade bs-example-modal-lg" id="modal_add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		  <div class="modal-dialog modal-lg">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
		        <h4 class="modal-title" id="myModalLabel">添加课程</h4>
		      </div>
		      <div class="modal-body">
		        	<form id="form_upload" class="form-horizontal"enctype="multipart/form-data" action="common/upload"method="post">
						<input type="hidden" name="previewPath">
							<div class="form-group">
							<label class="required"></label>
								<div class="col-md-12">
									<div style="width:100px;height:100px;"class="col-sm-offset-2 col-sm-2"><label class=" control-label required">封面图片&nbsp;</label> 
										<div id="IE_PIC">
											<a href=""  target="_blank"> <img id="bigPic_Show"style="width:100px;height:100px;border:2px solid #5A979D;border-radius:8px;" src=""alt="logo" /></a>
										</div>
										<input type="file" name="file"  style="margin-top:10px;"class="container" data-toggle="tooltip" data-placement="top" title="请上传图片">
									</div>
									</div>
							</div>
						</form>
				<br><br><br>
				
		         <form id="form_add" class="form-horizontal" role="form">
				  	  <div class="form-group">
						  <label class="col-sm-2 control-label required">课程标题</label>
						  <div class="col-sm-4">
						     <input type="text" name="title" placeholder="50个字符以内,如:2016级建造师全科套餐" class="form-control" data-toggle="tooltip" data-placement="top" title="请输入不多于50个字符" >
						  </div>
						 <label class="col-sm-2 control-label required">讲师</label>
						  <div class="col-sm-4">
									<select class="form-control" name="teacher" placeholder="选择讲师"
										data-toggle="tooltip" data-placement="top" title="请选择讲师">
										<option value="0" selected="selected">请选择...</option>
										<option value="11">胡月</option>
									</select>
						  </div>
					  </div>
					  <div class="form-group">
								<label class="col-md-2 control-label required">一级分类</label>
								<div class='col-md-2'>
									<select class="form-control" name="top" placeholder="选择一级分类"
										data-toggle="tooltip" data-placement="top" title="请选择一级分类">
										<option value="0" selected="selected">请选择...</option>
									</select>
								</div>
								
								<label class="col-md-2 control-label">二级分类</label>
 								<div class='col-md-2'>
									<select class="form-control" name=second  placeholder="选择分类"
										data-toggle="tooltip" data-placement="top" title="请选择分类">
										<option value="0" selected="selected">请选择分类...</option>
									</select>
								</div>
								 
								<label class="col-md-2 control-label">三级分类</label>
 								<div class='col-md-2'>
									<select class="form-control" name="detail"  placeholder="选择分类"
										data-toggle="tooltip" data-placement="top" title="请选择分类">
										<option value="0" selected="selected">请选择分类...</option>
									</select>
								</div> 								
					  </div>
				  	  <div class="form-group">
						  <label class="col-sm-2 control-label required">开始时间</label>
						  <div class="col-sm-4">
						     <input type="date" name="add_startTime" placeholder="开始时间" class="form-control" data-toggle="tooltip" data-placement="top" title="请选择开始时间" >
						  </div>
						  <label class="col-sm-2 control-label required">结束时间</label>
						  <div class="col-sm-4">
						     <input type="date" name="add_endTime" placeholder="结束时间" class="form-control" data-toggle="tooltip" data-placement="top" title="请选择结束时间" >
						  </div>
					  </div>					  
 					<div class="form-group">
						<label class="col-sm-2 control-label required" >规划体系</label>
						  <div class="col-sm-4">
							      	<select class="form-control" name="hierId" placeholder="选择规划体系"
										data-toggle="tooltip" data-placement="top" title="请选择规划体系">
										<option value="0" selected="selected">请选择规划体系...</option>
									</select>
						  </div>
						  
						  <label class="col-sm-2 control-label required">等级</label>
						  	<div class="col-sm-4">
							      	<select class="form-control" name="grade" placeholder="选择等级"
										data-toggle="tooltip" data-placement="top" title="请选择等级">
										<option value="1" selected="selected">入门</option>
										<option value="2" >进阶</option>
									</select>								
							</div>
					  </div>					  
				  	  <div class="form-group">
						  <label class="col-sm-2 control-label required">标签</label>
						  <div class="col-sm-10">
							<input id="tags"  name="tags" type="text" class="tags" value="" />
						  </div>
					  </div>
					  
				  	  <div class="form-group">
						  <label class="col-sm-2 control-label required">文件简介</label>
						  <div class="col-sm-10">
							<%=htmlData%>
							<!-- <form name="example" method="post" action="file_list.jsp"> -->
								<textarea id ="introduction" name="content1" cols="100" rows="8" style="width:100%;height:200px;" ><%=htmlspecialchars(htmlData)%></textarea>
								<br />
								<!--<input type="submit" name="button" value="提交内容" /> (提交快捷键: Ctrl + Enter)
							 </form>	 -->				
						</div>
					  </div>				  
				</form>
		      </div>
		      <div class="modal-footer">
					<button id="btn_confirm_add" type="button" class="btn btn-primary">确定</button>
		      </div>
		    </div>
	   </div>
	</div>
	
 </div>
  </body>
</html>
<%!
private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
}
%>